package com.ruijie.autotest.log.validation.hangzhoudewangxin.HBLOC;

import com.mchange.v2.c3p0.ComboPooledDataSource;
import com.ruijie.autotest.log.core.validate.IValidator;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.context.annotation.Bean;

import javax.sql.DataSource;

import static com.ruijie.autotest.log.impl.validate.SqlExistingValidator.sqlExistingVerificationOf;

@SpringBootConfiguration
public class Config {
	@Bean
	public DataSource dataSource() {
		return new ComboPooledDataSource("remote");
	}

	@Bean
	public IValidator locationCodeValidator(DataSource dataSource) {
		return sqlExistingVerificationOf("s_location.code", dataSource);
	}
}
